import { _get, _post, _upload } from "./config";

export const uploadToOSS = (url, pms) => _upload(url, pms)
export const getSDKConfig = (pms) => _get('jsapiticket/getConfig.json', pms)


/* 群主端 */
export const register = pms => _post('groupholder/register.json', pms)
export const addCourseConf = pms => _post('coursemanager/addCourse.json', pms)
export const getCourseConf = pms => _get('coursemanager/selectCourseByHolderId.json', pms)
export const updateCourseConf = pms => _post('coursemanager/updateCourse.json', pms)
export const updateCourseCode = pms => _post('coursemanager/updateHeadUrl.json', pms)
export const getCountByCity = pms => _get('groupholder/selectHolderCountByCity.json', pms)
export const getAllPost = pms => _get('coursemanager/selectAllPost.json', pms)
export const getSummary = () => _get('groupholder/getSummary.json')
export const getStudents = pms => _get('groupholder/getCustomersByHolderId.json', pms)
export const getlessonDetail = pms => _get('groupholder/selectLessonByPrimaryKey.json', pms)
export const getLesson = pms => _post('groupholder/selectLesson.json', pms)
export const updateCustomerStatus = pms => _post('groupholder/updateCustomerStatus.json', pms)

/* 学员端 */
export const getLessonByVisitor = pms => _post('customerlogin/selectLesson.json', pms)
export const getCourseConfByVisitor = pms => _get('customer/selectCourseByHolderId.json', pms)
export const getStudentsByVisitor = pms => _get('customer/getCustomersByHolderId.json', pms)
export const getTimestamp = () => _get('public/getTimestamp.json')
export const getlessonDetailByVisitor = pms => _get('customer/selectLessonByPrimaryKey.json', pms)  // lessonId, holderId
export const addShareCount = pms => _post('customer/addShareCount.json', pms)
export const shareGoalAchieved = pms => _get('customer/shareGoalAchieved.json', pms)
export const statusVerify = pms => _get('customerlogin/verify', pms)